package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 采集任务信息对象 collection_task
 *
 * @author ruoyi
 * @date 2025-04-30
 */
public class CollectionTask extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 任务唯一标识 */
    private Long id;

    /** 所属项目名称 */
    @Excel(name = "所属项目名称")
    private String projectName;

    /** 任务名称 */
    @Excel(name = "任务名称")
    private String taskName;

    /** 任务类型（如 datax 等） */
    @Excel(name = "任务类型", readConverterExp = "如=,d=atax,等=")
    private String taskType;

    /** 调度表达式（用于定时任务） */
    @Excel(name = "调度表达式", readConverterExp = "用=于定时任务")
    private String cronExpression;

    /** 触发时间，可记录最近一次触发时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "触发时间，可记录最近一次触发时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date triggerTime;

    /** 任务状态 */
    @Excel(name = "任务状态")
    private String taskStatus;

    /** 目标表 */
    @Excel(name = "目标表")
    private String targetTable;

    /** 数据源 */
    private String dataSource;

    //更新时间
    private Date updateTime;

    @Override
    public Date getUpdateTime() {
        return updateTime;
    }

    @Override
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /** 执行 SQL 语句内容（如果有相关 SQL 操作） */
    @Excel(name = "执行 SQL 语句内容", readConverterExp = "如=果有相关,S=QL,操=作")
    private String executionSql;

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setProjectName(String projectName)
    {
        this.projectName = projectName;
    }

    public String getProjectName()
    {
        return projectName;
    }

    public void setTaskName(String taskName)
    {
        this.taskName = taskName;
    }

    public String getTaskName()
    {
        return taskName;
    }

    public void setTaskType(String taskType)
    {
        this.taskType = taskType;
    }

    public String getTaskType()
    {
        return taskType;
    }

    public void setCronExpression(String cronExpression)
    {
        this.cronExpression = cronExpression;
    }

    public String getCronExpression()
    {
        return cronExpression;
    }

    public void setTriggerTime(Date triggerTime)
    {
        this.triggerTime = triggerTime;
    }

    public Date getTriggerTime()
    {
        return triggerTime;
    }

    public void setTaskStatus(String taskStatus)
    {
        this.taskStatus = taskStatus;
    }

    public String getTaskStatus()
    {
        return taskStatus;
    }

    public void setTargetTable(String targetTable)
    {
        this.targetTable = targetTable;
    }

    public String getTargetTable()
    {
        return targetTable;
    }

    public void setExecutionSql(String executionSql)
    {
        this.executionSql = executionSql;
    }

    public String getExecutionSql()
    {
        return executionSql;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("projectName", getProjectName())
            .append("taskName", getTaskName())
            .append("taskType", getTaskType())
            .append("cronExpression", getCronExpression())
            .append("triggerTime", getTriggerTime())
            .append("taskStatus", getTaskStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("targetTable", getTargetTable())
            .append("executionSql", getExecutionSql())
            .toString();
    }
}
